#@admin_layout()
#define admin_main()
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
	<legend>新增用户</legend>
</fieldset>
#if(usernameMsg || passwordMsg || nicknameMsg)
<blockquote class="layui-elem-quote layui-text">
	#(usernameMsg)
	#(passwordMsg)
	#(nicknameMsg)
</blockquote>
#end
<form class="layui-form" action="/user/save">
	<div class="layui-form-item">
		<label class="layui-form-label">用户名</label>
		<div class="layui-input-inline">
			<input type="text" name="user.username" value="#(user.username??)" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
		</div>
		<div class="layui-form-mid layui-word-aux">#(usernameMsg)</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">密码</label>
		<div class="layui-input-inline">
			<input type="password" name="user.password" value="#(user.password??)" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
		</div>
		<div class="layui-form-mid layui-word-aux">#(passwordMsg)</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">昵称</label>
		<div class="layui-input-inline">
			<input type="text" name="user.nickname" lay-verify="required" placeholder="" value="#(user.nickname??)" autocomplete="off" class="layui-input">
		</div>
		<div class="layui-form-mid layui-word-aux">#(nicknameMsg)</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">性别</label>
		<div class="layui-input-inline">
			<input type="radio" name="user.sex" value="男" title="男" checked="">
			<input type="radio" name="user.sex" value="女" title="女">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">签名</label>
		<div class="layui-input-inline">
			<input type="text" name="user.sign" value="#(user.sign??)" placeholder="" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-input-block">
			<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
			<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		</div>
	</div>
</form>
#end

#define admin_script()
<script>
	layui.use('form', function(){
		var form = layui.form;

		//监听提交
		form.on('submit(formDemo)', function(data){
			layer.msg(JSON.stringify(data.field));
//			return false;
		});
	});
</script>
#end